import request from '@/utils/request'

/**
 * 获取企业列表
 * @param { page, pageSize} params
 * @returns
 */
export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}
export function getIndustryListAPI() {
    return request({
      url: '/park/industry'
    })
  }

  export function uploadAPI(data) {
    return request({
      url: '/upload',
      method: 'POST',
      data
    })
  }

  export function createExterpriseAPI(data) {
    return request({
      url: 'park/enterprise',
      method: 'POST',
      data
    })
  }

  export function getEnterpriseDetailAPI(id) {
    return request({
      url: `/park/enterprise/${id}`
    })
  }

  export function updateExterpriseAPI(data) {
    return request({
      url: '/park/enterprise',
      method: 'PUT',
      data
    })
  }
  
  export function delExterpriseAPI(id) {
    return request({
      url: `/park/enterprise/${id}`,
      method: 'DELETE'
    })
  }
// 园区管理-查询可租赁楼宇
  export function getRentBuildListAPI() {
    return request({
      url: '/park/rent/building'
    })
  }

  export function createRentAPI(data) {
    return request({
      url: '/park/enterprise/rent',
      method: 'POST',
      data
    })
  }

  /**
 * 获取合同列表
 * @param {*} id
 * @returns
 */
export function getRentListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}

export function outRentAPI(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'PUT'
  })
}

export function delRentAPI(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'DELETE'
  })
}

export function getEnterpriseDetail(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'GET'
  })
}